const mongoose = require('mongoose')
const moment = require('moment')
const schema = new mongoose.Schema({
  name: {
    type: String,
    defualt: '匿名用户'
  },
  ctime: {
    type: String,
    default: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
  },
  content: {
    type: String,
    default: null
  },
  rate: {
    type: String
  },
  artId: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: 'News',
  }
})

module.exports = mongoose.model('News', schema)